package com.asen.libcommon.util.xpopup

import com.lxj.xpopup.core.BasePopupView
import com.lxj.xpopup.interfaces.XPopupCallback

/**
 * @date   : 2021/12/22
 * @author : asenLiang
 * @e-mail : 375427684@qq.com
 * @desc   : 继承XPopup接口，可以实现回调
 */


open interface XPopupSimpleCallback:XPopupCallback {
    override fun onCreated(popupView: BasePopupView?) {
    }

    override fun beforeShow(popupView: BasePopupView?) {
    }

    override fun onShow(popupView: BasePopupView?) {
    }

    override fun onDismiss(popupView: BasePopupView?) {
    }

    override fun beforeDismiss(popupView: BasePopupView?) {
    }

    /**
     * 暴漏返回按键的处理，如果返回true，XPopup不会处理；如果返回false，XPopup会处理，
     */
    override fun onBackPressed(popupView: BasePopupView?): Boolean {
        return true
    }

    override fun onKeyBoardStateChanged(popupView: BasePopupView?, height: Int) {
    }

    override fun onDrag(popupView: BasePopupView?, value: Int, percent: Float, upOrLeft: Boolean) {
    }
}